<meta content="telephone=no" name="format-detection" />
<title>{$sys_name} - {$lang.kjlb}</title>
<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="renderer" content="webkit">

    <link rel="shortcut icon" href="favicon.ico">
    <link href="/css/bootstrap.min14ed.css?v=3.3.6" rel="stylesheet">
    <link href="/css/font-awesome.min93e3.css?v=4.4.0" rel="stylesheet">
    <link href="/css/animate.min.css" rel="stylesheet">
    <link href="/css/style.min862f.css?v=4.1.0" rel="stylesheet">
    <link href="/css/plugins/treeview/bootstrap-treeview.css" rel="stylesheet">
    <!-- Bootstrap -->
    <link href="/css/css/bootstrap.min.css" rel="stylesheet">
    <link href="/css/css/reset.css" rel="stylesheet">
    <link href="/css/css/style.css" rel="stylesheet">

    <script src="/js/js/jquery-1.11.3.min.js" type="text/javascript"></script>
    <script src="/js/js/respond.js" type="text/javascript"></script>
    <script src="/js/js/common.js" type="text/javascript"></script>
    <script src="/js/js/bootstrap-datetimepicker.min.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
    <!--[if lt IE 9]>
    <script src="//cdn.bootcss.com/html5shiv/3.7.2/html5shiv.min.js"></script>
    <script src="//cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
</head>
<body class="bg">
<!--头部-->
<include file="Public/Home/confirm.html" />
<include file="Public/Home/Pubheader.html" />
<section class="wrapper"style="padding:0">
    <!--左侧导航-->
    <include file="Public/Home/Menu.html" />

    <div class="content-area">
        <div class="t80"></div>
        <div class="z_top">
            <div class="location">
                <img src="images/location.png" alt="">
                <span>{$lang.ur_here}：{$lang.kjlb}</span>
            </div>
        </div>
        <div class="content">
            <div class="main_top bq_bg" >
                <div class="font18 f2">
                    <img src="images/top_icon3.png" alt="">
                    <p style="margin-top: 10px;width: 70%">
                        理财收益：<span>{$lc_sy}</span><em>{$B}</em>
                    </p>
                </div>

            </div>
            <div class="zj_tab" style="padding-bottom: 10px;position: relative">
                <div class="zj1">
                    <ul>
                        <a href="{:U('User/kj_list')}">
                            <li <if condition="$status eq 0">class="zj_cur" </if>>{$lang.all}</li>
                        </a>
                        <a href="{:U('User/kj_list',array('status'=>1))}" style="display: none">
                            <li <if condition="$status eq 1">class="zj_cur" </if>>矿机模式</li>
                        </a>
                        <a href="{:U('User/kj_list',array('status'=>2))}" style="display: none">
                            <li <if condition="$status eq 2">class="zj_cur" </if>>理财模式</li>
                        </a>
                    </ul>
                    <a style="position: absolute;right: 30px;" href="{:U('User/mykj')}">我的投资记录</a>
                </div>

                <form action="{:U('User/kjlist')}"  method="post" name="myform" style="display: none">
                <div class="zj2">
                    <p class="zj2_text">{$lang.cxrq}</p>
                    <p class="zj2_date">
                        <input type="text" id="startDate" name="reservatTime" value="{$start_time}" readonly class="form_datetime">
                        <span>-</span>
                        <input type="text" id="endDate" name='leaveTime' value="{$end_time}"  readonly class="form_datetime">
                    </p>
                    <p class="zj2_btn">
                        <input type="hidden" name="status" class="btn_zj" value="{$status}">
                        <input type="submit" class="btn_zj" value="">
                    </p>
                </div>
                </form>

            </div>
            <div class="clear"></div>
            <div class="fx_tab">
                <div class="table-responsive block_tab1 ">
                    <table>
                        <tr>
                            <if condition="$is_mobile neq 1">
                            </if>
                            <th>名称</th>
                            <th>{$lang.money}({$B})</th>
                            <if condition="$is_mobile neq 1">
                                <th>周期</th>
                            </if>
                            <th style="display: none">利率</th>
                            <if condition="$is_mobile neq 1">
                                <th style="display: none">剩余</th>
                                <th style="display: none">需要捐赠</th>
                                <th style="display: none">释放本金</th>
                                <th>说明</th>
                            </if>
                            <th>类型</th>
                            <if condition="$is_mobile eq 1">
                                <th>详情</th>
                            </if>
                            <th>购买</th>
                        </tr>

                        <foreach name="kjlist" item="item">

                            <tr class="tab_bg">
                                <td>{$item.name}</td>
                                <td><if condition="$item.type eq 1">{$item.price}<else/>{$item.price2_s} - {$item.price2_e}</if></td>
                                <if condition="$is_mobile neq 1">
                                <td>{$item.cycle}天</td>
                                </if>
                                <td style="display: none">{$item.lilv}%</td>
                                <if condition="$is_mobile neq 1">
                                    <td style="display: none"><if condition="$item.type eq 1">{$item.sy}个<else/>{$item.sy_m}{$B}</if></td>
                                    <td style="display: none">
                                        <if condition="$item.need_seat eq 1">是<else/>否</if>
                                    </td>
                                    <td style="display: none">
                                        <if condition="$item.shifang eq 1">是<else/>否</if>
                                    </td>
                                    <td>{$item.msg}</td>
                                </if>
                                <td>
                                    <if condition="$item.type eq 1">矿机模式<else/>理财模式</if>
                                </td>
                                <if condition="$is_mobile eq 1">
                                    <td onclick="check_fk({$item.id})">
                                        查看
                                    </td>
                                </if>

                                <td>
                                    <if condition="$item.id neq 1">
                                        <a onclick="buythis({$item['id']},0,0)" style="color:#0dae8d">立即购买</a>
                                    </if>
                                </td>
                            </tr>
                            <div class="msg_box ggxq" id="fknr_{$item.id}" style="min-height: auto;display: none">
                                <h3>产品详情</h3>
                                <div class="tab-content" >
                                    <div id="" class="tab-pane active">
                                        <div class="full-height-scroll">
                                            <div class="table-responsive" style="padding-bottom: 10px;padding-left: 5px">
                                                <div class="fk_ban fk_ban1" style="width: 25%;margin: 10px 0;line-height:auto">名称：</div>
                                                <div style="width: 70%;float: left;margin: 10px 0;word-break: break-all">
                                                    {$item.name}
                                                </div>
                                                <div class="fk_ban fk_ban1" style="width: 25%;margin: 10px 0;line-height:auto">价格：</div>
                                                <div style="width: 70%;float: left;margin: 10px 0;word-break: break-all">
                                                    <if condition="$item.type eq 1">{$item.price}<else/>{$item.price2_s} - {$item.price2_e}</if>{$B}
                                                </div>
                                                <div class="fk_ban fk_ban1" style="width: 25%;margin: 10px 0;line-height:auto">周期：</div>
                                                <div style="width: 70%;float: left;margin: 10px 0;word-break: break-all">
                                                    {$item.cycle}天
                                                </div>
                                                <div class="fk_ban fk_ban1" style="width: 25%;margin: 10px 0;line-height:auto">每日奖励：</div>
                                                <div style="width: 70%;float: left;margin: 10px 0;word-break: break-all">
                                                    {$item.day_num}/天
                                                </div>
                                                <!--div class="fk_ban fk_ban1" style="width: 25%;margin: 10px 0;line-height:auto;">利率：</div>
                                                <div style="width: 70%;float: left;margin: 10px 0;word-break: break-all;">
                                                    {$item.lilv}%
                                                </div-->

                                                <if condition="$item.type eq 1">
                                                    <!--div class="fk_ban fk_ban1" style="width: 25%;margin: 10px 0;line-height:auto">剩余数量：</div>
                                                    <div style="width: 70%;float: left;margin: 10px 0;word-break: break-all">
                                                        {$item.sy}个
                                                    </div>
                                                    <else/>
                                                    <div class="fk_ban fk_ban1" style="width: 25%;margin: 10px 0;line-height:auto">剩余金额：</div>
                                                    <div style="width: 70%;float: left;margin: 10px 0;word-break: break-all">
                                                        {$item.sy_m}{$B}
                                                    </div-->
                                                </if>

                                                <!--div class="fk_ban fk_ban1" style="width: 25%;margin: 10px 0;line-height:auto">需要捐赠：</div>
                                                <div style="width: 70%;float: left;margin: 10px 0;word-break: break-all">
                                                    <if condition="$item.need_seat eq 1">是<else/>否</if>
                                                </div>
                                                <div class="fk_ban fk_ban1" style="width: 25%;margin: 10px 0;line-height:auto">释放本金：</div>
                                                <div style="width: 70%;float: left;margin: 10px 0;word-break: break-all">
                                                    <if condition="$item.shifang eq 1">是<else/>否</if>
                                                </div-->
                                                <div class="fk_ban fk_ban1" style="width: 25%;margin: 10px 0;line-height:auto">类型：</div>
                                                <div style="width: 70%;float: left;margin: 10px 0;word-break: break-all">
                                                    <if condition="$item.type eq 1">矿机模式<else/>理财模式</if>
                                                </div>
                                                <div class="fk_ban fk_ban1" style="width: 25%;margin: 10px 0;line-height:auto">说明：</div>
                                                <div style="width: 70%;float: left;margin: 10px 0;word-break: break-all">
                                                    {$item.msg}
                                                </div>

                                                <div style="width: 100%;float: left">
                                                    <div style="width: 80px;margin: auto;line-height: 30px;text-align: center;background: #0dae8d;color: #fff;margin-top: 20px;cursor: pointer" onclick="close_fk({$item.id})">关闭</div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        </foreach>

                        <div class="msg_box ggxq" id="buy_price" style="min-height: auto;display: none;position: fixed;left: 0;width: 350px">
                            <h3>购入金额</h3>
                            <div class="tab-content" >
                                <div id="" class="tab-pane active">
                                    <div class="full-height-scroll">
                                        <form action="{:U('User/buy_kj')}" method="post" name="buy_price_form" id="buy_price_form">
                                            <div class="table-responsive" style="padding-bottom: 10px;padding-left: 5px;padding-top: 10px;">
                                                <div style="width: 300px;margin: auto">
                                                    <div style="line-height: 35px;width: 100px;float: left;">可投资范围：</div>
                                                    <div style="line-height: 35px;float: left;width: 200px;text-indent: 5px"><span id="fw"></span> {$B}</div>
                                                </div>
                                                <div style="width: 300px;margin: auto">
                                                    <div style="line-height: 35px;width: 100px;float: left;">请输入金额：</div>
                                                    <input type="text" name="buy_price" style="line-height: 35px;float: left;width: 200px;text-indent: 5px" value="">
                                                    <input type="hidden" name="kjid" id="kjid" value="">
                                                </div>
                                                <div style="width: 100%;float: left">
                                                    <div style="width: 80px;line-height: 30px;text-align: center;background: #0dae8d;color: #fff;margin-top: 20px;cursor: pointer;margin-left: 50px;float: left" onclick="subthis()">购买</div>
                                                    <div style="width: 80px;line-height: 30px;text-align: center;background: #0dae8d;color: #fff;margin-top: 20px;cursor: pointer;margin-right: 50px;float: right" onclick="close_bp()">关闭</div>
                                                </div>
                                            </div>
                                        </form>
                                    </div>
                                </div>
                            </div>
                        </div>

                    </table>
                </div>
            </div>
            <script>
                function check_fk(id){
                    $("#fknr_"+id).show();
                }

                function close_fk(id){
                    $("#fknr_"+id).hide();
                }
                function close_bp(){
                    $("#buy_price").hide();
                }
            </script>

            <!--分页-->
            <input type="hidden" id="page_url" value="kj_list&status={$status}">

            <div style="line-height: 30px;float: right;margin-top: 20px" class="pages">
                <ul>
                    <li style="width: 20%;float: left;text-align: center;cursor: pointer;list-style-type: none;"><a onclick="page_up()">上一页</a></li>
                    <li style="width: 25%;float: left;text-align: center;font-size: 14px;list-style-type: none;">
                        <if condition="$count eq 0 ">0
                            <else/>
                            <input type="text" onchange="gopage({$page_all})" id="gopage" value="{$page}" style="width: 40%;border: none;background: none;text-align: right;line-height: 30px;font-size: 15px;padding-bottom: 5px;padding-right: 5px">
                        </if>
                        /{$page_all}
                    </li>
                    <li style="width: 20%;float: left;text-align: center;cursor: pointer;list-style-type: none;"><a onclick="page_down({$page_all})">下一页</a></li>
                    <li style="width: 35%;float: left;text-align: center;font-size: 14px;list-style-type: none;">共{$count}条记录</li>
                </ul>
            </div>
            <script type="text/javascript">
                function buythis(id,price1,price2){
                    $("#buy_price").hide();
                    if(price1 == 0 && price2 == 0){
                        confirm1("确定要购买该理财产品吗？","{:U('User/buy_kj')}"+"&kjid="+id)
                    }else{
                        $("#buy_price").show();
                        $("#fw").text(price1 +" - "+ price2);
                        $("#kjid").val(id);
                    }
                }
                function subthis(){
                    document.buy_price_form.submit();
                }
                var page_url = document.getElementById("page_url").value;
                function gopage(page_all){
                    var url = window.location.href;
                    var status = getQueryString('status');
                    var n=(url.split('&status='+status)).length;
                    if(n==2){
                        var url = url.replace("&status="+status,"");
                    }

                    var a = getQueryString('a');
                    url = changeURLPar(url, 'a', page_url);
                    var page = document.getElementById("gopage").value;
                    if(page <= page_all){
                        url = changeURLPar(url, 'page', page);
                        window.location.href = url
                    }else{
                        url = changeURLPar(url, 'page', page_all);
                        window.location.href = url
                    }
                }
                //下一页
                function page_down(page_all){
                    var url = window.location.href;
                    var status = getQueryString('status');
                    var n=(url.split('&status='+status)).length;
                    if(n==2){
                        var url = url.replace("&status="+status,"");
                    }
                    var page = getQueryString('page');
                    var a = getQueryString('a');
                    url = changeURLPar(url, 'a', page_url);
                    if(page_all > 1 && page == null){
                        window.location.href = url+"&page=2"
                    }else{
                        if(page < page_all){
                            page = Number(page) + Number(1);
                            url = changeURLPar(url, 'page', page);
                            window.location.href = url
                        }else{
                            window.location.href = url
                        }

                    }
                }
                //上一页
                function page_up(){
                    var url = window.location.href;
                    var status = getQueryString('status');
                    var n=(url.split('&status='+status)).length;
                    if(n==2){
                        var url = url.replace("&status="+status,"");
                    }
                    var page = getQueryString('page');
                    var a = getQueryString('a');
                    url = changeURLPar(url, 'a', page_url);
                    if(page == 1 || page == null){
                        window.location.href = url
                    }else{
                        page = Number(page) - Number(1);
                        url = changeURLPar(url, 'page', page);
                        window.location.href = url
                    }
                }
                //改url参数  destinv = url   par = 要改的参数  par_value = 新参数值
                //url = changeURLPar(url, 'page', page);
                function changeURLPar(destiny, par, par_value)
                {
                    var pattern = par+'=([^&]*)';
                    var replaceText = par+'='+par_value;
                    if (destiny.match(pattern))
                    {
                        var tmp = '/\\'+par+'=[^&]*/';
                        tmp = destiny.replace(eval(tmp), replaceText);
                        return (tmp);
                    }
                    else
                    {
                        if (destiny.match('[\?]'))
                        {
                            return destiny+'&'+ replaceText;
                        }
                        else
                        {
                            return destiny+'?'+replaceText;
                        }
                    }
                    return destiny+'\n'+par+'\n'+par_value;
                }

                //获取参数值   name=参数名
                //var page = getQueryString('page');
                function getQueryString(name) {
                    var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
                    var r = window.location.search.substr(1).match(reg);
                    if (r != null) return unescape(r[2]); return null;
                }

            </script>

        </div>

    </div>
</section>
<!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
<!-- Include all compiled plugins (below), or include individual files as needed -->
<script src="/js/js/bootstrap.js"></script>
<script>
    // 	表单提交
    var bool = false;
    function toSubmit() {
        var name = $('#reservationName').val();
        var mobile = $('#reservationPhone').val();
        var id = $('#reservationId').val();
        // 		$('form').submit(function(){
        if ($("#endDate").val() == '') {
            showMsg('请选择离店时间！');
            bool = false;
            return bool;
        } else {
            bool = true;
        }
        if (bool) {
            var sdate = new Date($("#startDate").val());
            var edate = new Date($("#endDate").val());

        }
        // 		});
    }

    var obj;
    // var id = ${roomId};
    // var sdate = new Date();
    var sdate = '2018-07-01';
    // $.post('../hotel/roomOrder',{id:id},function(data){
    //   if(data.code==1000){
    //     if(data.result.hotelOrder.leaveTime != undefined){
    //       if(data.result.hotelOrder.leaveTime.time > new Date().getTime()){
    //         sdate = new Date(data.result.hotelOrder.leaveTime.time);
    //       }
    //     }
    //   }

    // 	alert(sdate);
    //     $.post('../hotel/reservatTime',{id:id},function(data){
    //       obj = data.result;
    obj = ['', '', '']; //禁用日期可以从数据库查
    // 	自定义格式
    $.fn.datetimepicker.dates['zdy'] = {
        days: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
        daysShort: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
        daysMin: ["日", "一", "二", "三", "四", "五", "六"],
        months: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
        monthsShort: ["1月", "2月", "3月", "4月", "5月", "6月", "7月", "8月", "9月", "10月", "11月", "12月"],
        today: "今天",
        format: "yyyy-mm-dd",
        titleFormat: "yyyy-mm-",
        weekStart: 1,
        suffix: [],
        meridiem: ["上午", "下午"]
    };
    $('#startDate').datetimepicker({
        language: 'zdy',
        weekStart: 1,
        todayBtn: 1,
        autoclose: 1,
        startDate: sdate,
        minView: 2,
        maxView: 3,
        onRenderDay: function(date) {
            // 	    	alert(date);
            var date1 = date.getFullYear() + '-' +
                    (date.getMonth() < 9 ? '0' + (date.getMonth() + 1) : date.getMonth() + 1) +
                    '-' +
                    (date.getDate() < 10 ? '0' + (date.getDate() - 1) : date.getDate() - 1);
            // for(var o in obj){
            //   if(date1==obj[o]){
            //     return ['disabled'];
            //   }
            // }

        }
    }).on('changeDate', function(ev) {
        // 		alert($("#startDate").val());
        $('#endDate').datetimepicker('remove');
        $('#endDate').val('');
        var sdate = $("#startDate").val();
        var edate;
        for (var o in obj) {
            if (new Date(sdate) <= new Date(obj[o])) {
                var date = new Date(obj[o])
                var ndate = +date + 24 * 60 * 60 * 1000;
                var leaveTime = new Date(ndate);
                edate = leaveTime.getFullYear() + '-' + (leaveTime.getMonth() + 1) + '-' + leaveTime.getDate();

                break;
            }
        }
        // 			alert(edate);
        $('#endDate').datetimepicker({
            language: 'zdy',
            weekStart: 1,
            todayBtn: 1,
            autoclose: 1,
            startDate: sdate,
            endDate: edate,
            minView: 2,
            maxView: 3
        }).on('changeDate', function(ev) {
            // 		            alert(o+++"~~")
        });
    });
    // });
    // });
    $("#endDate").click(function() {
        if ($("#startDate").val() != '') {

        } else {
            showMsg('请先选择时间！');
        }
    });
</script>
<script type="text/javascript" language="javascript">
    var nav1 = document.getElementById("nav1");
    var links1 = nav1.getElementsByTagName("li");
    var lilen1 = nav1.getElementsByTagName("a");
    var currenturl1 = document.location.href;
    var last1 = 0;
    for (var i1=0;i1<links1.length;i1++)
    {
        var linkurl1 = lilen1[i1].getAttribute("href");
        if(currenturl1.indexOf(linkurl1)!=-1)
        {
            last1 = i1;
        }
    }

    links1[last1].className = "cur1";

</script>
</body>
</html>
